;;; $DOOMDIR/config.el -*- lexical-binding: t; -*-

;; Place your private configuration here! Remember, you do not need to run 'doom
;; sync' after modifying this file!


;; Some functionality uses this to identify you, e.g. GPG configuration, email
;; clients, file templates and snippets.
(setq user-full-name "Retaw Jin"
      user-mail-address "retaw106@hotmail.com")

;; Doom exposes five (optional) variables for controlling fonts in Doom. Here
;; are the three important ones:
;;
;; + `doom-font'
;; + `doom-variable-pitch-font'
;; + `doom-big-font' -- used for `doom-big-font-mode'; use this for
;;   presentations or streaming.
;;
;; They all accept either a font-spec, font string ("Input Mono-12"), or xlfd
;; font string. You generally only need these two:
;; (setq doom-font (font-spec :family "monospace" :size 12 :weight 'semi-light)
;;       doom-variable-pitch-font (font-spec :family "sans" :size 13))
(setq doom-font (font-spec :family "monospace" :size 18 :weight 'semi-light)
      doom-variable-pitch-font (font-spec :family "sans" :size 18))

;; There are two ways to load a theme. Both assume the theme is installed and
;; available. You can either set `doom-theme' or manually load a theme with the
;; `load-theme' function. This is the default:
(setq doom-theme 'doom-one)

;; If you use `org' and don't want your org files in the default location below,
;; change `org-directory'. It must be set before org loads!
(setq org-directory "~/org/")

;; This determines the style of line numbers in effect. If set to `nil', line
;; numbers are disabled. For relative line numbers, set this to `relative'.
(setq display-line-numbers-type nil)


;; Here are some additional functions/macros that could help you configure Doom:
;;
;; - `load!' for loading external *.el files relative to this one
;; - `use-package!' for configuring packages
;; - `after!' for running code after a package has loaded
;; - `add-load-path!' for adding directories to the `load-path', relative to
;;   this file. Emacs searches the `load-path' when you load packages with
;;   `require' or `use-package'.
;; - `map!' for binding new keys
;;
;; To get information about any of these functions/macros, move the cursor over
;; the highlighted symbol at press 'K' (non-evil users must press 'C-c c k').
;; This will open documentation for it, including demos of how they are used.
;;
;; You can also try 'gd' (or 'C-c c d') to jump to their definition and see how
;; they are implemented.
;;(use-package! sis
;;  :config
;;  (sis-ism-lazyman-config "1033" "2052" 'im-select)
;;  ;; enable the /cursor color/ mode
;;  (sis-global-cursor-color-mode t)
;;  ;; enable the /respect/ mode
;;  (sis-global-respect-mode t)
;;  ;; enable the /follow context/ mode for all buffers
;;  (sis-global-follow-context-mode t)
;;  ;; enable the /inline english/ mode for all buffers
;;  (sis-global-inline-mode t)
;;  )
  
(add-to-list 'initial-frame-alist '(fullscreen . maximized))

(setq doom-theme 'doom-tomorrow-night)

(add-to-list 'auto-mode-alist '("//.//(org//  |org_archive//|txt//)$" . org-mode))
(setq org-agenda-files '("D:/docs/agenda"))
(use-package! org-bullets
  :config
  (progn
    (setq org-bullets-bullet-list '("☰" "☷" "☯" "☭"))
    (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))
    ))
(after! org-superstar
  (setq org-superstar-headline-bullets-list '("◉" "○" "✸" "✿" "✤" "✜" "◆" "▶")
        ;; org-superstar-headline-bullets-list '("Ⅰ" "Ⅱ" "Ⅲ" "Ⅳ" "Ⅴ" "Ⅵ" "Ⅶ" "Ⅷ" "Ⅸ" "Ⅹ")
        org-superstar-prettify-item-bullets t ))
(after! org
  (setq org-ellipsis "▼"
        org-priority-highest ?A
        org-priority-lowest ?E
        org-priority-faces
        '((?A . 'all-the-icons-red)
          (?B . 'all-the-icons-orange)
          (?C . 'all-the-icons-yellow)
          (?D . 'all-the-icons-green)
          (?E . 'all-the-icons-blue))))

(use-package! org-roam
    :hook
    (after-init . org-roam-mode)
    :custom
    (org-roam-directory "~/org-roam")
    :bind (:map org-roam-mode-map
          (("C-c n l" . org-roam)
           ("C-c n f" . org-roam-find-file)
           ("C-c n g" . org-roam-graph-show)
           ("C-c n c" . org-roam-capture))
          :map org-mode-map
          (("C-c n i" . org-roam-insert))
          (("C-c n I" . org-roam-insert-immediate)))
    :config
    (setq org-roam-capture-templates
    '(("d" "default" plain (function org-roam--capture-get-point)
    "%?"
    :file-name "%<%Y%m%d%H%M%S>-${slug}"
    :head "#+title: ${title}\n#+roam_alias: \n#+roam_tags: \n\n"
    :unnarrowed t)
    ("c" "concept" plain (function org-roam--capture-get-point)
    "* 领域\n%?\n* 释义\n\n* Links\n"
    :file-name "concepts/${slug}"
    :head "#+title: ${title}\n#+roam_alias:\n#+roam_tags: \n\n"
    :unnarrowed t)
    ("p" "Paper Note" plain (function org-roam--capture-get-point)
    "* 文章\n%?\n* 相关工作\n\n* 观点\n\n* 模型和方法\n\n* 实验\n\n* 结论\n\n* 评论\n\n* Links\n"
    :file-name "%<%Y%m%d%H%M%S>-${slug}"
    :head "#+title: ${title}\n#+roam_alias:\n#+roam_tags: \n\n"
    :unnarrowed t
    )
    ("b" "Book Note" plain (function org-roam--capture-get-point)
    "* 书籍\n%?\n* 位置\n\n* 观点\n\n* 引申\n\n* 疑问\n\n* Links\n"
    :file-name "%<%Y%m%d%H%M%S>-${slug}"
    :head "#+title: ${title}\n#+roam_alias:\n#+roam_tags: \n\n"
    :unnarrowed t
    )))
    )
(use-package! org-roam-protocol
  :after org-protocol)

(use-package! org-roam-server
  :config
  (setq org-roam-server-host "127.0.0.1"
        org-roam-server-port 8082
        org-roam-server-authenticate nil
        org-roam-server-export-inline-images t
        org-roam-server-serve-files nil
        org-roam-server-served-file-extensions '("pdf" "mp4" "ogv")
        org-roam-server-network-poll t
        org-roam-server-network-arrows nil
        org-roam-server-network-label-truncate t
        org-roam-server-network-label-truncate-length 60
        org-roam-server-network-label-wrap-length 20))
        
(setq reftex-default-bibliography '("D:/papers/zotero_files/我的文库.bib"))
(setq org-ref-bibliography-notes "D:/papers/zotero_files/notes.org"
      org-ref-default-bibliography '("D:/papers/zotero_files/我的文库.bib")
      org-ref-pdf-directory "D:/papers/zotero_files/bibtex-pdfs/")
(setq org-ref-completion-library 'org-ref-ivy-cite)
(require 'org-ref)

(use-package org-roam-bibtex
  :after org-roam
  :hook (org-roam-mode . org-roam-bibtex-mode)
  :bind (:map org-mode-map
         (("C-c n a" . orb-note-actions)
         ("C-c n b" . orb-find-non-ref-file))))
         
(global-visual-line-mode t)
